﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Pku.BookStore.IServices;
using Pku.BookStore.Model;

namespace Pku.BookStore.Services
{
    [Serializable]
    [ServiceBehavior(IncludeExceptionDetailInFaults = true, ConcurrencyMode = ConcurrencyMode.Multiple)]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class OperateLogServices : IOperateLogServices
    {
        /// <summary>
        /// 获取实例名
        /// </summary>
        private DAL.OperateLogDAL operateLogDAL
        {
            get
            {
                return new DAL.OperateLogDAL();
            }
        }

        /// <summary>
        /// 增加日志
        /// </summary>
        /// <param name="entity"></param>
        public void Add(OperateLogModel entity)
        {
            operateLogDAL.Add(entity);
        }

        /// <summary>
        /// 查询日志
        /// </summary>
        /// <returns></returns>
        public List<OperateLogModel> Search(OperateLogParam param)
        {
            return operateLogDAL.Search(param);
        }

        /// <summary>
        /// 获取实体
        /// </summary>
        /// <param name="logID"></param>
        /// <returns></returns>
        public OperateLogModel GetEntityById(int logID)
        {
            return operateLogDAL.GetEntityById(logID);
        }

    }
}
